<template>
<view>
   <view class="top">
      <navigator url="../../packageB/DetailsOfWithdrawal/DetailsOfWithdrawal">
         <a>提现明细</a>
      </navigator>
      <view class="money">￥{{getList.total}}</view>
      <view class="xiang">累计佣金(元)</view>
   </view>
   <view class="content-a">
      <text>可提现佣金</text>
      <text>{{getList.total}}元</text>
   </view>
   <view class="content">
      <view class="content-b">
         <text>已申请佣金</text>
         <text>{{getList.applied}}元</text>
      </view>
      <view class="content-b">
         <text>待打款佣金</text>
         <text>{{getList.to_play_with}}元</text>
      </view>
      <view class="content-b">
         <text>无效佣金</text>
         <text>{{getList.efficacy}}元</text>
      </view>
      <view class="content-b">
         <text>成功提现佣金</text>
         <text>{{getList.success}}元</text>
      </view>
   </view>
   <!-- <view class='content-c'>
      <view class='content-b'>
         <text>待收货佣金</text>
         <text>{{getList.receiving}}元</text>
      </view>
      <view class='content-b'>
         <text>未结算佣金</text>
         <text>{{getList.no_settlement}}元</text>
      </view>
   </view>
   <van-collapse value="{{ activeNames }}" bind:change="onChange">
      <van-collapse-item title="用户须知" name="1">
      提供多样店铺模板，快速搭建网上商城
   </van-collapse-item>
  </van-collapse> -->
   <button @tap="tixian" hover-class="none">我要提现</button>
</view>
</template>

<script>
// hotmall/packageB/DistributionCommission/DistributionCommission.js
var app = getApp();
import api from "../../../api";

export default {
  data() {
    return {
      active: 1,
      getList: [],
      uid: '',
      activeNames: ""
    };
  },

  components: {},
  props: {},

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    wx.getStorage({
      key: 'userId',
      success: res => {
        console.log(res);
        this.setData({
          uid: res.data
        });
        this.getListFun();
      }
    });
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {},

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {},

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {},

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {},

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {
    this.getListFun();
    wx.stopPullDownRefresh();
  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {},

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {},
  methods: {
    getListFun: function () {
      app.globalData.request({
        url: api.default.distribution_brokerage,
        header: {
          'content-type': 'application/x-www-form-urlencoded'
        },
        data: {
          user_id: this.uid
        },
        method: 'POST',
        success: res => {
          console.log(res);
          this.setData({
            getList: res.data
          });
        }
      });
    },

    tixian() {
      wx.navigateTo({
        url: '../Cash/Cash'
      });
    },

    onChange(event) {
      this.setData({
        activeNames: event.detail
      });
    }

  }
};
</script>
<style>
@import "./DistributionCommission.css";
</style>